Preventing overdraw with the Sorting Filter

In Kanzi nodes are presented for rendering from top to bottom of the project tree as shown in the Kanzi Studio Project. You can change the rendering of 3D nodes by using filters.

Overdraw issues occur when one node is first drawn to an area of pixels in the back buffer, after which another node is presented that occludes the first node, and the same pixels are filled again. Excessive overdraw can decrease performance on the GPU in the form of increased fill-rate. If you order nodes so that the occluding node is drawn first, the occluded pixels do not have to be rendered again because of the depth buffering.

You can prevent overdraw by sorting 3D nodes with a Sorting Filter into front-to-back order before rendering, and by hiding known invisible items. This adds some overhead to the CPU, because nodes are ordered before drawing and updated when transformations in the scene are changed (for example, through animations).

Viewing the overdraw of objects

Overdraw visualization shows a lot of intensity in areas where fragments are unnecessarily rendered.

To view overdraw in your application:

Using a Sorting Filter to render from front to back

To use a Sorting Filter to render from front to back:

  1. In the Library press Alt and right-clickComposing > Pipeline and select Sorting Filter.
  2. In the Properties set properties:
    • Sorting Type to View z
    • Enable the Reverse Order property
  3. In the Library > Composing > Composers select the render pass you use to render your scene.
  4. In the Properties set the Object Source property to the sort filter you created in the first step of this procedure.

The default Sorting Filter rearranges the scene in the front-to-back order. However, you can select only a part of the scene in your project. This is useful if the GPU fill-rate, lighting, texturing or fragment shaders are known bottlenecks for performance in your application. See Using Tag Filter filters.

Test the effect of ordering on the overall performance by measuring the frame rate in both cases. See Measuring the performance of your application.

See also

Rendering best practices

Optimizing the rendering of layouts

Setting nodes for efficient rendering

Using Tag Filter filters

Rendering static content

Rendering transparent nodes

Measuring the performance of your application

Best practices